#include <QtCore/QObject>
#include <QtCore/QVariant>
#include <QtGui/QAction>
#include <QtGui/QApplication>
#include <QtGui/QButtonGroup>
#include <QtGui/QHeaderView>
#include <QtGui/QMainWindow>
#include <QtGui/QMenu>
#include <QtGui/QMenuBar>
#include <QtGui/QStatusBar>
#include <QtGui/QToolBar>
#include <QtGui/QWidget>
#include "cgraphicsview.h"
#include "uiview.h"


CUiView::CUiView(QMainWindow * mainWindow)
{
	setupUi(mainWindow);
	QObject::connect(graphicsView, SIGNAL(valueChanged(int)), this, SLOT(uncheck_addstation(int)));
}


CUiView::~CUiView(void)
{
}

void CUiView::uncheck_addstation(int matrix)
{
	//Each button has it own bit in matrix 
	//so each bit can keep value of bit 0 or 1
	//so to disable 1 and 3 button and enable 2
	//just pass 01000000 - int: = 2 :)
	if(matrix & 1){
		actionAdd_connections->setChecked(false);
		actionAdd_train->setChecked(false);
	}else if(matrix & 2){
		actionAdd_station_3->setChecked(false);
		actionAdd_train->setChecked(false);
	}else{
		actionAdd_connections->setChecked(false);
		actionAdd_station_3->setChecked(false);
	}
	//actionAdd_station_3->setDisabled(true);
}